# $Id: PKGBUILD 67540 2012-03-13 11:23:22Z giovanni $
# Maintainer: Ray Rashif <schivmeister@gmail.com>

pkgname=dssi-vst
pkgver=0.9.2
pkgrel=2
pkgdesc="DSSI adapter/wrapper for win32 VST plug-ins"
arch=('i686')
url="http://www.breakfastquay.com/dssi-vst/"
license=('GPL')
depends=('wine' 'jack' 'liblo')
makedepends=('dssi' 'ladspa')
source=("http://code.breakfastquay.com/attachments/download/10/$pkgname-$pkgver.tar.bz2"
	'winexec.patch')
md5sums=('5c569200571de76dac18be4eb6fbd9c8'
         '7578313fb2861165ed349cef1d02f829')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # fix executable extension issue
  patch -Np1 -i "${srcdir}/winexec.patch"

  # use CXXFLAGS in build
  sed -i \
    "s:-Ivestige -Wall -fPIC:$CXXFLAGS -Ivestige -Wall -fPIC:" Makefile

  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make	BINDIR="$pkgdir/usr/bin" \
  	DSSIDIR="$pkgdir/usr/lib/dssi" \
	LADSPADIR="$pkgdir/usr/lib/ladspa" install

  # dssi-vst does not know about the executable extension issue
  cd "$pkgdir/usr/lib/dssi/dssi-vst"

  mv dssi-vst-server.exe dssi-vst-server
  mv dssi-vst-scanner.exe dssi-vst-scanner
}
